<#assign title="数据统计页面">
<#include "/admin/inc/top.html"/>
<div class="main-content" id="main-content">
    <header class="header navbar bg-white shadow">

    </header>
    <section class="content">
        <div>
            活动参与人数：(总:${allUserCount!0}/日增${todayUserCount!0})<br>
            活动参与人次：(总:${allTimesCount!0}/日增${todayTimesCount!0})<br>
            中奖人数:(总:${allPrizedCount!0}/日增${todayPrizedCount!0})<br>
        </div>
        <div class="panel-body" style="padding-top: 50px;">
            <div class="table-responsive no-border">
                <input id="unitid" type="hidden">
                <table class="table table-bordered table-striped mg-t datatable">
                    <thead>
                    <tr>
                        <th>人保保单号</th>
                        <th>奖品ID0：特等奖 1~3一二三等奖</th>
                        <th>奖品内容</th>
                        <th>中奖活动名称</th>
                        <th>用户抽奖时间</th>
                        <th>领奖人手机号</th>
                        <th>领奖人姓名</th>
                        <th>领奖人邮编</th>
                        <th>领奖人地址</th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>

        <!-- 用户中奖列表详情 -->
        <div id="dialogUserDetail" class="modal fade bs-modal-sm" data-autoClear tabindex="-3" role="dialog" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">

                </div>
            </div>
        </div>
    </section>
</div>
    <script type="text/javascript">
        var datatable;
        function initDatatable() {
            datatable = $('.datatable').DataTable({
                "dom": '<"toolbar">frtip',
                "searching": false,
                "processing": true,
                "serverSide": true,
                "select": true,
                "ordering": true,
                "language": {
                    "url": "${base!}/static/admin/js/lib/datatables/js/cn.json"
                },
                "preDrawCallback": function () {

                },
                "drawCallback": function () {

                },
                "ajax": {
                    "url": "${base!}/private/picc/tongji/allPrizedData",
                    "type": "post",
                    "data": function (d) {
                        d.extend={
                            typeId:'${typeId!0}'
                        };
                        return JSON.stringify(d);
                    },
                    "dataType": "json",
                    "processData": false,
                    "contentType": 'application/json;charset=UTF-8'
                },
                //"order": [[0, "desc"]],
                "order": [],
                "columns": [
                    {"data": "pid", "bSortable": false},
                    {"data": "prizeId", "bSortable": false},
                    {"data": "prizeDetail", "bSortable": false},
                    {"data": "typeName", "bSortable": false},
                    {"data": "prizeDate", "bSortable": false},
                    {"data": "phoneNum", "bSortable": false},
                    {"data": "userName", "bSortable": false},
                    {"data": "zcode", "bSortable": false},
                    {"data": "address", "bSortable": false},
                ],
                "createdRow": function (row, data, rowIndex) {
                    $(row).attr("data-rowId",data.id);
                }
            });
            datatable.on('click', 'tr', function () {
                $(this).toggleClass('selected');
            });
        }

        function showDetail(id){
            $("#dialogUserDetail").modal({
                remote:"${base!}/private/picc/prizeList/detail/"+id
            });
        }


        $(document).ready(function () {
            initDatatable();
        });
    </script>
    <#include "/admin/inc/bottom.html"/>